package com.loiot.baqi.dao;

import java.sql.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import com.loiot.baqi.pojo.TgSuggestBugInfo;
import com.loiot.baqi.utils.DBParams;
import com.loiot.commons.utils.JsonUtil;
import com.timeloit.pojo.Account;


/**
 * base数据访问层。
 * 
 * @author 
 */
@Repository("baseDao")
public class BaseDao extends BaseDaoV1 {
    
    /**
     * 
     * id 条件
     * @return 
     */
    public Object getObjectById(java.lang.Long id,Class clazz)throws Exception {
		Class<?> t = Class.forName(clazz.getName());
    	String sqlId = t.getSimpleName()+".get"+t.getSimpleName()+"ById";
    	HashMap<String, Object> pMap = new HashMap<String, Object>();
    	pMap.put("suggestId", id);
    	return getSqlSession().selectOne(sqlId, pMap);
    }
    
    /**
     * 
     * id 条件
     * @return 
     */
   
    public Object getObjectById(java.lang.Long id,String idName,Class clazz)throws Exception {
		Class<?> t = Class.forName(clazz.getName());
    	String sqlId = t.getSimpleName()+".get"+t.getSimpleName()+"ById";
    	HashMap<String, Object> pMap = new HashMap<String, Object>();
    	pMap.put(idName, id);
    	return getSqlSession().selectOne(sqlId, pMap);
    }
}
